Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add subform layoutset #13632

Merged
merged 33 commits into from
Sep 30, 2024
Merged

feat: Add subform layoutset #13632

merged 33 commits into from
Sep 30, 2024

Conversation

lassopicasso
Copy link
Contributor

@lassopicasso lassopicasso commented Sep 25, 2024

Description

This PR introduces the ability for users to add subform layout sets when the feature flag subForm is enabled.

Key Changes:

  • Temporary UX: Since the design is not finalized, this PR focuses solely on functionality, using a temporary user interface.
  • Layout Set Selector:
    • The existing layout set selector is replaced with a combobox that provides descriptions for the layout sets.
    • If a layout set is a subform, it is labeled with the description text "Underskjema".
    • Regular layout sets do not have a description.
  • New Buttons:
    • Add New Subform: Allows users to add a subform layout set. Reusing the validation hook useValidateLayoutSetName
    • Delete Selected Subform: Allows users to delete a subform. The delete button is disabled when a regular layout set is selected.
  • Data Storage:
    • When a new subform is created, it is stored in layout-sets.json.
    • Regular layout sets are stored with a tasks property, while subforms are identified by a type property.

Once this PR is merged, issue #13475 can be unblocked.

image image

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Sep 25, 2024
@lassopicasso lassopicasso changed the title Add subform layoutset feat: Add subform layoutset Sep 25, 2024
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 98.50746% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.24%. Comparing base (ba935fe) to head (b864a3f).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...or/src/components/Elements/LayoutSetsContainer.tsx 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13632      +/-   ##
==========================================
+ Coverage   94.23%   94.24%   +0.01%     
==========================================
  Files        1528     1532       +4     
  Lines       20814    20868      +54     
  Branches     2511     2516       +5     
==========================================
+ Hits        19614    19668      +54     
  Misses        951      951              
  Partials      249      249              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lassopicasso lassopicasso linked an issue Sep 25, 2024 that may be closed by this pull request
@lassopicasso lassopicasso marked this pull request as ready for review September 25, 2024 12:47
@framitdavid framitdavid self-assigned this Sep 25, 2024
Copy link
Collaborator

@framitdavid framitdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @lassopicasso! This looks good for me now. 👏

Copy link
Contributor

@standeren standeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments to consider 🌟

@framitdavid framitdavid assigned standeren and unassigned framitdavid Sep 27, 2024
Copy link
Contributor

@standeren standeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🥳 Lets release the blocked issue 😈

@framitdavid framitdavid merged commit 2bc8404 into main Sep 30, 2024
16 checks passed
@framitdavid framitdavid deleted the add-subform-layoutset branch September 30, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support adding a SubForm layoutset
3 participants